<?php
include_once 'inc/config.inc.php';
include_once 'inc/mysql.inc.php';
include_once 'inc/tool.inc.php';

$link=connect();
if(!isset($_GET['id']) || !is_numeric($_GET['id'])){
	skip("{$_GET["url"]}",'error','id参数错误！');
}
//删除我的留言
if(isset($_GET['content'])){

	if($_GET['id']){
		$query="delete from feedback where id={$_GET['id']}";
		$result=execute($link,$query);
		if(mysqli_affected_rows($link)==1){
			skip("{$_GET["url"]}",'ok','恭喜你删除成功！');
		}else{
			skip("{$_GET["url"]}",'error','对不起删除失败，请重试！');
		}
	}
}

//删除我的评论
if(isset($_GET['info'])){

	if($_GET['id']){
		$query="delete from comment where id={$_GET['id']}";
		$result=execute($link,$query);
		if(mysqli_affected_rows($link)==1){
			skip("{$_GET["url"]}",'ok','恭喜你删除成功！');
		}else{
			skip("{$_GET["url"]}",'error','对不起删除失败，请重试！');
		}
	}
}

close($link);

?>

